<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      header {
        height: 46px;
        width: 100%;
        background-color: pink;
      }
      footer {
        height: 50px;
        width: 100%;
        background-color: blue;
      }
      main {
        background-color: #ccc;
        height: calc(100vh - 46px - 50px);
      }
      /* 子元素永远比父元素的宽少20px calc计算函数 c3中 运算符两端必须有空格*/
      /* .container {
        width: 1000px;
        height: 50px;
        background-color: purple;
      }
      .inner {
        height: 40px;
      
        width: calc(100% - 20px);
        background-color: red;
      } */
    </style>
  </head>
  <body>
    <div class="box">
      <header></header>
      <main></main>
      <footer></footer>
    </div>
    <hr />
    <!-- <div class="container">
      <div class="inner"></div>
    </div> -->
  </body>
</html>
